<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/static/commons/taglibs.jsp"%>
<%@ include file="/static/commons/meta.jsp"%>
<%@ include file="/static/commons/jquery-easyui.jsp"%>
<html >
	 <head>
 		<title>${title }</title>
 		<link rel="stylesheet" href="${ctx }/static/styles/basic/basic.css" />
		<link rel="stylesheet" href="${ctx }/static/styles/frame/main.css" />
		<link rel="stylesheet" href="${ctx }/static/styles/frame/searchBtn.css" />
		<link rel="stylesheet" href="${ctx }/static/styles/frame/searchCondition.css" />
	    <!-- js -->
 		<script type="text/javascript" src="${ctx}/static/scripts/check_all.js"></script>
 		<script type="text/javascript" src="${ctx}/static/scripts/set_select.js"></script>
 		<script type="text/javascript" src="${ctx}/static/scripts/waiting.js"></script>
 		<script type="text/javascript" src="${ctx}/static/scripts/crud.js"></script>
 		<script type="text/javascript" src="${ctx}/static/scripts/common.js"></script>
 		<script type="text/javascript" src="${ctx}/static/scripts/util.js"></script>


		 <object  id="LODOP_OB" classid="clsid:2105C259-1E0C-4534-8141-A753534CB4CA" width=0 height=0>
			 <embed id="LODOP_EM" type="application/x-print-lodop" width=0 height=0></embed>
		 </object>

		 <script type="text/javascript" src="${ctx}/static/widgets/lodop/LodopFuncs.js"></script>


	 </head>
  <body onload="init()">
		<form action="${ctx}/makeController/list" method="post">
  			<input type="hidden" name="RequestVerificationToken" value="${RequestVerificationToken}" />
			<div class="width_100 group_box">
				<div class="group_search width_100">
					<vvise:select id="custId" name="p_custId" sqlname="getCust" displayText="用户单位" ifSearch="true"/>
		            <vvise:select id="deviceType" name="p_deviceType" sqlname="getCodeData" sqlparam="device_type" displayText="类型" ifSearch="true"/>
		            <vvise:searchInput id="orderId" name="p_orderId" displayText="订单号" />
			        <div class="clear_both"></div>
				</div>
				<vvise:funMenu menuId="${menuId}" />
			</div>
        </form>
        <div class="listFrame">
        	<iframe name="listFrame" id="listFrame" frameBorder="0"
				scrolling="auto" style="width: 100%;height:100%;"></iframe>
        </div>
	</body>
	<script type="text/javascript">
  		var headers = {};
		headers['__RequestVerificationToken'] = "${RequestVerificationToken}";
			//回车事件
		document.onkeydown = keyKistener;
		function keyKistener(e){
			e = e ? e:event;
			if(e.keyCode == 13){
				try{
					search();
				}catch(e){}
			}
		}
		function init(){
			set_iframe_h();
			$(window).resize(function(){
				set_iframe_h();
			});
			search();
			$('.easyui-combobox').combobox();
		}
		//设置ifream 高度
		function set_iframe_h(){
			var win_height  = $(window).height();
			var func_line_h = $('.group_box').outerHeight(true);
			var list_height = win_height - func_line_h;
			$('.listFrame').css('height',list_height-10);
		}
		
		function search(){
			waiting();
			document.forms[0].target = "listFrame";
			document.forms[0].submit();
		}


        function view(custId, deviceType, orderId){
            var pp = parent;
            doView("检查仪器信息",pp.width3+400, 500,"${ctx}/makeController/viewList?p_custId="+custId+"&p_deviceType="+deviceType+"&p_orderId="+orderId);
        }


        function batchPrintCert(orderId){
            var $src = "${ctx}/template/";
            var frontUrl=$src+"showCertFront?";
            var backUrl=$src+"showCertBack?";




            $.ajax({
                cache: false,
                type: "POST",
                headers: headers,
                url:'${ctx}/makeController/batchPrint?orderId='+orderId,
                async: false,
                error: function(request) {
                    pp.$.messager.alert('操作提示',"操作失败！","error");
                },
                success: function(data) {
                    if(data!=null && data!=""){
                        debugger;
                        for(var i=0; i<data.length; i++){
                            frontUrl+="orderId="+data[i].order_id+"&equId="+data[i].equ_id;
                            backUrl+="orderId="+data[i].order_id+"&equId="+data[i].equ_id;
                            LODOP=getLodop();
                            LODOP.PRINT_INIT("打印控件功能演示_Lodop功能_同时打印俩网址");
                            LODOP.ADD_PRINT_URL(30,20,"100%","100%",location.protocol+"//"+location.host+frontUrl);
                            LODOP.ADD_PRINT_URL(1100,20,"100%","100%",location.protocol+"//"+location.host+backUrl);
                            LODOP.SET_PRINT_STYLEA(0,"HOrient",2);
                            LODOP.SET_PRINT_STYLEA(0,"VOrient",3);
                            LODOP.SET_PRINT_MODE("PRINT_DUPLEX",2);//0-不控制 1-不双面 2-双面(长边装订) 3-小册子双面(短边装订_长边水平)
                            LODOP.SET_PRINT_MODE("PRINT_DEFAULTSOURCE",1);//1-纸盒 4-手动 7-自动 0-不控制
                            LODOP.SET_PRINT_MODE("DOUBLE_SIDED_PRINT",true);//如打印机无双面打印功能，也可手工实现，此时需true
//                            LODOP.PRINT();
                            LODOP.PREVIEW();

                        }
                    }
                }
            });
		}



		function printCertList(orderId,orderType){
            var url= location.protocol+"//"+location.host+"${ctx}/makeController/showCertificateList?orderId="+orderId+"&deviceType="+orderType;
			debugger;
            LODOP=getLodop();
            LODOP.PRINT_INIT("打印控件功能演示_Lodop功能_按网址打印");
//                LODOP.ADD_PRINT_URL(30,20,746,"95%", url);
            LODOP.ADD_PRINT_URL(100,100,"94%","100%",url);
            LODOP.SET_PRINT_STYLEA(0,"HOrient",2);
            LODOP.SET_PRINT_STYLEA(0,"VOrient",3);
            //		LODOP.SET_SHOW_MODE("MESSAGE_GETING_URL",""); //该语句隐藏进度条或修改提示信息
            //		LODOP.SET_SHOW_MODE("MESSAGE_PARSING_URL","");//该语句隐藏进度条或修改提示信息
            LODOP.PREVIEW();
		}

		
		</script>
</html>